﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HCM_maps_website.Models;
using HCM_maps_website.Process.DAL;

namespace HCM_maps_website.Process.BLL
{
    public class ServiceBLL
    {
        ServiceDAO server = new ServiceDAO();
        /*
        public string NormalizeKeyword(string keyWord)
        {
            string result = StringHelper.StandardizeString(keyWord);
            string path = HttpContext.Current.Server.MapPath("../abbreviation.xml");
            result = StringHelper.GetSearchString(result, path);
            return result;
        }
         */

        public IList<ServiceModel> FindServiceByKeyword(string keyword)
        {
            //keyword = NormalizeKeyword(keyword);
            return server.GetServiceByKeyword(keyword);
        }

        public IList<ServiceModel> FindServicesInArea(Coordinate start, Coordinate end)
        {
            return server.GetServicesInArea(start, end);
        }

        public IList<ServiceModel> FindServiceAround(Coordinate place, float r)
        {
            return server.GetServiceAround(place, r);
        }

        public IList<ServiceModel> FindServiceAroundWithServiceType(int typeID, Coordinate point , float radius)
        {
            return server.GetServiceAroundWithServiceType(typeID,point, radius);
        }

        public IList<ServiceModel> FindServiceByTypeAndDistance(int id, Coordinate place, int limit)
        {
            return server.GetServiceByPlaceTypeAndDistance(1, new Coordinate(10.6726,106.8678), 3);
        }
    }
}